const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: [{
      "id": "137b3d78c9814b738a627874f63d13bd",
      "creatDate": null,
      "orderNum": "20200226194022001",
      "orderMoney": "159",
      "procuctPrice": "159",
      "productNum": "1"
    }, {
      "id": "5225c5e4512c41228b8058c34b386671",
      "creatDate": null,
      "orderNum": "20200313114512589",
      "orderMoney": "159",
      "procuctPrice": "159",
      "productNum": "1"
    }],
    date: '2020-04-08',//默认起始时间  
    date2: '2020-04-08',//默认结束时间 
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var id = options.id
    this.setData({
      id: id
    })
    this.myRequest(id)
  },

  myRequest:function(id){
    var that = this
    wx.getStorage({
      key: 'openid',
      success: function (res) {
        let openid = res.data

        wx.request({
          url: app.globalData.URL + '/app/team/myTeams1?openid=' + id + '&fDate=' + that.data.date + '&lDate=' + that.data.date2,
          success: function (res) {
            console.log(res)
            that.setData({
              list: res.data.list
            })
          }
        })
      },
    })
  },

  bindDateChange(e) {
    let that = this;
    console.log(e.detail.value)
    that.setData({
      date: e.detail.value,
    })
    that.myRequest(that.data.id)
  },
  bindDateChange2(e) {
    let that = this;
    that.setData({
      date2: e.detail.value,
    })
    that.myRequest(that.data.id)
  },

 
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  

 
})